import React, { Component } from 'react';
import { Tabs } from 'antd';
import { observable } from 'mobx';
import { observer, inject } from "mobx-react";
import PropTypes from 'prop-types';

const TabPane = Tabs.TabPane;

@observer
class ShopIndex extends Component {
  componentDidMount() {
  }

  callback = (key) => {
    const { history } = this.props;
    history.push(`/goodsitem/${key}`);
  }

  static propTypes = {
    match: PropTypes.object.isRequired,
    location: PropTypes.object.isRequired,
    history: PropTypes.object.isRequired
  }

  render() {
    return (
      <div>
        <p>商品管理</p>
        <Tabs
          activeKey={this.props.match.params.tabs}
          onChange={this.callback}>
          <TabPane tab="Tab 1" key="1">Content of Tab Pane 1</TabPane>
          <TabPane tab="Tab 2" key="2">Content of Tab Pane 2</TabPane>
          <TabPane tab="Tab 3" key="3">Content of Tab Pane 3</TabPane>
        </Tabs>
      </div>
    )
  }
}

export default ShopIndex;
